import { getItem, setItem } from '@/utils/storage'
import type {
  BaseInfoType,
  UserInfo,
  MenuListItem
} from '@/store/type/baseInfo'

export default {
  namespaced: true,
  state: () => ({
    userInfo: getItem('userInfo'),
    menuList: []
  }),
  getters: {},
  mutations: {
    setUserInfo (state: BaseInfoType, payload: UserInfo) {
      state.userInfo = payload
      setItem('userInfo', payload)
    },
    setMenuList (state: BaseInfoType, payload: MenuListItem[]) {
      state.menuList = payload
    }
  },
  actions: {}
}
